<template>
  <div class="page">
    <heads></heads>
    <div class="page-content" style="width: 100%;background: #fff">
      <div class="main-body">

          <div class="pay-home description">
            <div>
              <span class="nameimg"></span>
              <span>{{userName || '--'}}</span>
            </div>
            <div>
              <span>余额：</span>
              <span class="orige">{{$store.state.moneys || '0'}}</span>
              <span>竞猜豆</span>
            </div>
          </div>
          <ul class="paymoneyList" style="min-height:380px;" >
            <li v-for="item,key in pageList">
              <span class="money-icon"></span>
              <span>
                  充值<span  class="orige">{{item.coin}}</span>竞猜豆
              </span>
              <span class="money-btn" @click='$router.push("/pay_detail?coin="+item.coin+"&money="+item.amount)'>&yen;{{item.amount}}</span>
            </li>
          </ul>
      </div>
    </div>
  </div>
</template>
<script>
  import heads from '../components/header'
  import { Loadmore,Toast ,MessageBox,MtButton } from 'mint-ui';
  export default {
    data(){
      return{

        pageList: [],

          userName:'',
          userMoney:'',
        islogin:sessionStorage.getItem('login')
      }
    },
    components: {
      heads,
      MtButton,

    },
    mounted() {
        var _this=this;
      this.payList();  //初次访问查询列表

      if(sessionStorage.getItem('login')!="true"){
        MessageBox.confirm('',{
          title: '',
          message: '未登录',
        }).then(action => {
          this.$router.push({path:'/login'})
        },()=>{//取消
          this.$router.go(-1)
        });
      }
    },
    methods:{
      prizeShop:function (id) {
        var _this=this;
      },

      payList: function() {
        var _this=this;
        this.$http(this.API.coinItems,{
          data:{}
        }).then(function(res) {
          _this.pageList=res.list
          if(res.userInfo){
            const eva=eval("("+res.userInfo+")")
            _this.$store.state.moneys=eva.coin;
            _this.userName=eva.uid
          }
          //console.log(_this.pageList)
        }).catch(function(err) {
          console.log(err);
        });
      },


    },

  }
</script>
<style>
  @import "../sass/pageScss/prize.scss";
</style>

